package com.demo.page9101.feign.column;

import com.demo.common.entity.ColumnManagement;
import com.demo.page9101.feign.impl.column.ColumnFeignImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
/**
 * 查询主栏目、次级栏目
 * 作者：孙佳佳
 */
@FeignClient(name = "houpu-service-bean",fallback = ColumnFeignImpl.class)
public interface ColumnFeign {

    /**
     * 查询所有主栏目
     * @return
     */
    @GetMapping("/column")
    ResponseEntity<List<ColumnManagement>> searchAllParent();

    /**
     * 根据父id查询所有子栏目
     * @param columnFatherId
     * @return
     */
    @GetMapping("/column/{columnFatherId}")
    ResponseEntity<List<ColumnManagement>> searchByParentId(@PathVariable Integer columnFatherId);
}
